package com.zuoshengli.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description TODO
 * @Author zuoshengli
 **/

@Configuration
@EnableConfigurationProperties(KafkaTopicProperties.class)
public class KafkaTopicConfiguration {

    @Autowired
    private KafkaTopicProperties kafkaTopicProperties;

    @Bean
    public String kafkaTopicName() {
        System.out.println(kafkaTopicProperties.getTopicName());
        return kafkaTopicProperties.getTopicName();
    }

    @Bean
    public String topicGroupId() {
        return kafkaTopicProperties.getGroupId();
    }
}
